package com.decent.web.system.controller;

import com.decent.common.bo.MessageBean;
import com.decent.web.system.service.SystemBrandService;
import com.decent.web.system.service.SystemGoodsService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: decent Gjh
 * @date: 2022/10/31/15:57
 * @description:
 */
@RestController
@RequestMapping("/hot")
public class HotInfoController {
    private final SystemGoodsService goodsService;
    private final SystemBrandService brandService;

    public HotInfoController(SystemBrandService brandService, SystemGoodsService goodsService) {
        this.brandService = brandService;
        this.goodsService = goodsService;
    }

    /**
     * 获取热门品牌
     * @return 热门品牌列表(最多5个)
     */
    @GetMapping("/brand")
    public MessageBean hotBrand(){
        return brandService.selectHotBrand();
    }

    /**
     * 获取热门商品
     * @return 热门商品列表(最多15个)
     */
    @GetMapping("/goods")
    public MessageBean hotGoods(){
        return goodsService.selectHotGoods();
    }

}
